home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / boosters.arc / BOXHEAP.PAS < prev    next >
Pascal/Delphi Source File  |  1985-11-03  |  2KB  |  56 lines

  1. { --------------------------------
  2.   BOXHEAP builds a box on the heap
  3.   at Page [n]
  4.   -------------------------------- }
  5. Procedure BoxHeap ( Page  :  HeapBuf;
  6.                     Start_Col, Start_Row,
  7.                     End_Col,   End_Row,   Style   : Integer;
  8.                     Attribute  : Byte);
  9.  
  10. Var
  11.    Ver_Adj, Hor_Adj, Num_Col, Num_Row : Integer;
  12.  
  13. Const
  14.                                   { DOWN  LL  OVER  LR   UR   UL }
  15.    s : array[1..4,1..6] of char = ((#179,#192,#196,#217,#191,#218),
  16.                                    (#186,#200,#205,#188,#187,#201),
  17.                                    (#186,#211,#196,#189,#183,#214),
  18.                                    (#179,#212,#205,#190,#184,#213));
  19.  
  20. begin
  21.    if (style < 1) or (style > 4) then
  22.       style := 1;
  23.    Num_Col := End_Col - Start_Col + 1;
  24.    Num_Row := End_Row - Start_Row + 1;
  25.    if Num_Col <= 2 then
  26.       Num_Col := 3;
  27.    if Num_Row <= 2 then
  28.       Num_Row := 3;
  29.    Ver_Adj := Num_Row - 2;
  30.    Hor_Adj := Num_Col - 2;
  31.  
  32.    PutHeap ( Page, V, s[style,6],
  33.                    Start_Col, Start_Row, Attribute);         { UL Corner  }
  34.  
  35.    PutHeap ( Page, V, COPIES( s[style,1], Ver_Adj),
  36.                    Start_Col,  Start_Row + 1, Attribute);    { Left Side  }
  37.  
  38.    PutHeap ( Page, V, s[style,2],
  39.                    Start_Col, End_Row, Attribute);           { LL Corner  }
  40.  
  41.    PutHeap ( Page, H, COPIES( s[style,3], Hor_Adj),
  42.                    Start_Col + 1, End_Row, Attribute);       { Bottom     }
  43.  
  44.    PutHeap ( Page, V, s[style,4],
  45.                    End_Col, End_Row, Attribute);             { LR Corner  }
  46.  
  47.    PutHeap ( Page, V, COPIES( s[style,1],Ver_Adj),
  48.                    End_Col, Start_Row + 1, Attribute);       { Right Side }
  49.  
  50.    PutHeap ( Page, V, s[style,5],
  51.                    End_Col, Start_Row, Attribute);           { UR Corner  }
  52.  
  53.    PutHeap ( Page, H, COPIES( s[style,3],Hor_Adj),
  54.                    Start_Col + 1, Start_Row, Attribute);     { Top        }
  55.  
  56. end { BoxHeap };